<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>增加会员</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../../../../elementUI/index.css">
  <link rel="stylesheet" href="../../../../css/index.css">
</head>

<body>
  <div id="app" class="minWidth">
    <el-form :model="form" ref="contract" inline-message="true" style="width: 100%">
      <div class="table_titel">
        <div class="titel">礼包卡主体信息</div>
      </div>
      <el-descriptions :column="2" border size="small">
        <el-descriptions-item label="礼品卡名">
          <el-form-item prop="Total_Amount">
            <el-input type="text" v-model.trim="form.Card_Name" placeholder="请输入礼品卡名"></el-input>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="面额">
          <el-form-item prop="Total_Amount">
            <el-input type="text" v-model.trim="form.Card_Amount" placeholder="请输入面额"></el-input>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="卡类别">
          <el-form-item prop="Total_Amount">
            <el-select @change="change" clearable v-model="form.Card_Type" placeholder="请选择卡类别">
              <el-option v-for="(item,i) in cardCategory" :key="i" :label="item.name" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
        <!-- <el-descriptions-item label="购买限制">
          <el-form-item prop="Total_Amount">
            <el-select @change="change" clearable v-model="form.Article_SerialNumber" placeholder="请选择您企业的所属商品">
              <el-option v-for="(item,i) in PurchaseRestrictions" :key="i" :label="item.name"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item> -->
        <el-descriptions-item label="描述说明">
          <el-form-item prop="Total_Amount">
            <el-input type="text" v-model.trim="form.Card_Describe" placeholder="请输入描述说明"></el-input>
          </el-form-item>
        </el-descriptions-item>
      </el-descriptions>
      <div>
        <div class="table_titel">
          <div class="titel">适用店铺</div>
          <div class="operation">
            <el-button type="primary" size="small" @click="add">新增</el-button>
            <el-button type="danger" size="small" @click="remove">删除</el-button>
          </div>
        </div>
        <el-descriptions :column="1" border size="small" v-for="(item,index) in form.Children.card_storescope"
          :key="index">
          <el-descriptions-item label="店铺编号">
            <el-form-item prop="Store_SerialNumber">
              <el-select v-model.trim="item.Store_SerialNumber" placeholder="请选择店铺" filterable style="width: 100%"
                @change="Change_Store_SerialNumber(index)">
                <el-option v-for="(item,index) in store" :key="index" :label="item.Store_Name"
                  :value="item.Store_SerialNumber"></el-option>
              </el-select>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="小程序App_ID">
            <el-form-item prop="App_ID">
              <span v-show="item.App_ID==''" style="color: rgb(163, 163, 163);">&nbsp;&nbsp;&nbsp; 请选择店铺</span>
              <span v-show="item.App_ID!=''">&nbsp;&nbsp;&nbsp;{{item.App_ID}}</span>
            </el-form-item>
          </el-descriptions-item>
        </el-descriptions>
      </div>
      <div class="table_titel">
        <div class="titel">销售价格单明细</div>
        <div class="operation">
          <el-button type="primary" size="small" @click="add1">新增</el-button>
          <el-button type="danger" size="small" @click="remove1">删除</el-button>
        </div>
      </div>
      <el-descriptions :column="3" border size="small" v-for="(item,index) in form.Children.card_article" :key="index">
        <el-descriptions-item label="商品编号">
          <el-form-item>
            <el-select v-model.trim="item.Article_SerialNumber" placeholder="请选择商品" filterable
              @change="Change_Unit_Price(index)" style="width: 100%">
              <el-option v-for="(item,index) in shop" :key="index" :label="item.Article_Name"
                :value="item.Article_SerialNumber"></el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="商品规格">
          <el-form-item>
            <el-select :disabled="isDisabled" v-model.trim="item.Article_Specifications_SerialNumber"
              placeholder="请选择规格" filterable style="width: 100%" @change="Change_Specifications_Name(specs,item.Article_Specifications_SerialNumber,index)">
              <el-option v-for="(item,index) in specs" :key="item.Article_Specifications_SerialNumber"
                :label="item.Specifications_Name" :value="item.Article_Specifications_SerialNumber"></el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="零售价">
          <el-form-item>
            <el-input v-model.trim="item.Unit_Price" disabled placeholder="零售价"></el-input>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="优惠价格">
          <el-form-item>
            <el-input v-model.trim="item.Preferential_Unit_Price"
              placeholder="请输入销售单价"></el-input>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="商品数量">
          <el-form-item>
            <el-input v-model.number="item.Quantity"
              placeholder="请输入数量"></el-input>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="设置有效期">
          <el-form-item>
            <div style="display: flex;">
              <el-input style="flex: 1;" type="number" v-model.trim="item.Card_Term" placeholder="请输入有效期"></el-input>
              <el-select style="width: 70%;" @change="change" clearable v-model="item.Time_Unit_SerialNumber"
                placeholder="请选择日期">
                <el-option v-for="(item,i) in dateCategory" :key="i" :label="item.Time_Name" :value="item.Time_Unit_SerialNumber">
                </el-option>
              </el-select>
            </div>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="设置开始时间">
          <el-form-item>
            <el-date-picker v-model="item.Start_Date"  format="yyyy-MM-dd HH:mm:ss"
            value-format="yyyy-MM-dd HH:mm:ss"  type="date" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-descriptions-item>
      </el-descriptions>
      <!-- <div style="margin-bottom: 100px;">
        <div class="table_titel">
          <div class="titel">商品信息</div>
        </div>
        <el-descriptions :column="3" border size="small">
          <el-descriptions-item label="商品图片">
            <el-form-item>
              <el-image style="width: 100px; height: 100px"
                src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" :fit="'fill'"></el-image>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="商品品牌">
            <el-form-item>
              <span>{{article_info.Brand_Name}}</span>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="商品类别">
            <el-form-item>
              <span>{{article_info.Category_Name}}</span>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="商品系列">
            <el-form-item>
              <span>{{article_info.Category_Name}}</span>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="商品款型">
            <el-form-item>
              <span>{{article_info.Category_Name}}</span>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="商品价格">
            <el-form-item>
              <span>￥{{article_info.Unit_Price}}</span>
            </el-form-item>
          </el-descriptions-item>
        </el-descriptions>
      </div> -->
      <el-form-item class="form-operation">
        <el-button @click="window.history.back()">返回</el-button>
        <el-button type="primary" :loading="loading" @click="submitForm()">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
  <script type="text/javascript" src="../../../../js/jquery-3.6.0.min.js"></script>
  <script type="text/javascript" src="../../../../js/jquery.cookie.js"></script>
  <script type="text/javascript" src="../../../../js/vue.min.js"></script>
  <script type="text/javascript" src="../../../../elementUI/index.js"></script>
  <script type="text/javascript" src="../../../../js/utils.js"></script>
  <script type="text/javascript" src="../../../../js/ID_Validity.js"></script>
  <script type="text/javascript" src="./js/Add.js"></script>
</body>

</html>